<?php
abstract class Pageley_Log_AbstractAppender implements Pageley_Log_Appender {
	
	private $treshold;
	
	public function __construct($treshold = null) {
        if($treshold === null) {
            $treshold = Pageley_Log_Level::$TRACE;
        }
		$this->treshold = $treshold;
	}
    
    public function append($message, $level) {
        if($level->compareTo($this->treshold) >= 0) {
            $this->appendInternal($message);
        }
	}
    
    protected abstract function appendInternal($message);
}